package com.mifengkong.cygshare.model;

import com.mifengkong.frtools.http.request.BaseRetrofit;
import com.mifengkong.frtools.util.FRLog;
import com.mifengkong.frtools.util.FRString;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by jack on 2018/1/16
 */

public abstract class BaseModel extends BaseRetrofit {

    protected CygApi mServletApi;
    protected Map<String, Object> mParams = new HashMap<>();

    public BaseModel() {
        super();
        mServletApi = mRetrofit.create(CygApi.class);
    }

    @Override
    protected Map<String, String> getCommonMap() {
        Map<String, String> mCommonParams = new HashMap<>();
        mCommonParams.put("token", FRString.valueOf("88fb6db499b29fc05d68817c9f317575"));
        return mCommonParams;
    }

    protected void addParamStrings(String key, Object value) {
        if (FRString.isEmpty(key)) {
            FRLog.error("key should not be null");
            return;
        }
        mParams.put(key, value);
    }

    protected void addParamStrings(Map<String, String> map) {
        if (null != map && map.size() > 0) {
            mParams.putAll(map);
        }
    }
}
